// Copyright (c) 2024-present AI-Labs

// @ ts-nocheck
import i18next from "i18next";
import { Resource } from "i18next";

import { UAIEditorOptions } from "@uai-team/uai-editor-common";

import { zh_CN } from "@/i18n/zh_CN.ts";
import { en_US } from "@/i18n/en_US.ts";

export function i18nextInit(options: UAIEditorOptions) {
    const i18nConfig = options.i18n || {};
    const resources = {
        zh_CN: { translation: { ...zh_CN, ...i18nConfig.zh_CN } },
        en_US: { translation: { ...en_US, ...i18nConfig.en_US } }
    } as Resource;
    i18next.init({
        lng: options.lang, resources,
    }, (_err, _t) => {
    });
}